// 权限类型定义
export const Permission = {
  id: '',
  name: '',
  code: '', // 如: 'user:create'
  description: ''
};

export const Role = {
  id: '',
  name: '',
  permissions: []
};

export const User = {
  id: '',
  username: '',
  roles: []
};

// 或者使用JSDoc注释方式
/**
 * @typedef {Object} Permission
 * @property {string} id
 * @property {string} name
 * @property {string} code 如: 'user:create'
 * @property {string} [description]
 */

/**
 * @typedef {Object} Role
 * @property {string} id
 * @property {string} name
 * @property {Permission[]} permissions
 */

/**
 * @typedef {Object} User
 * @property {string} id
 * @property {string} username
 * @property {Role[]} roles
 */